from random import randint

randNum = randint(1, 100)

def attempt():
  guessCount = 0
  userGuess = input("Please guess a number, or type 'exit'")
  guessCount += 1
  while guessCount <= 6:
    if userGuess.isdigit():
      if userGuess == randNum:
        print "You win!"
      elif userGuess > randNum:
        print "Too high!"
        attempt()
    	elif userGuess < randNum:
        print "Too low!"
        attempt()
    	elif userGuess == "exit":
        return False
    else:
      print "You can not guess a string. Guess a number"
      attempt()
  else:
    print "You are out of guesses!"
    return False

attempt()